import React from 'react';
import CeateDataSource from './createDataSource';
import {Table} from "antd";
import { request,useRequest } from 'umi';

export default () => {

  const { data, error, loading } = useRequest('/api/dataSource/list');
  if (error) {
    return <div>{error.message}</div>;
  }
  return (
    <div>
      <CeateDataSource
        // refreshInit={null}
        name='新建'/>
      <Table
        loading={ loading }
        dataSource={data?.dataSource}
        columns={data?.columns} />
    </div>
  );
}

